package br.com.iqt;

import br.com.iqt.exception.DbmsException;
import java.sql.*;
import java.util.ArrayList;

public class AgentWorkLoad {
    DriverWorkload driver;

    public AgentWorkLoad(Dbms dbms) throws DbmsException, ClassNotFoundException {
        switch(dbms.getDbms()){
            case Dbms.POSTGRESQL:
                driver = new DriverWorkloadPostgresql(dbms);
                break;
            case Dbms.SQLSERVER:
                driver = new DriverWorkloadSqlserver(dbms);
                break;
            case Dbms.ORACLE:
                driver = new DriverWorkloadOracle(dbms);
                break;
            default:
                throw new DbmsException("SGBD inválido!");
        }
    }
    
    public ArrayList getWorkLoad() throws ClassNotFoundException, SQLException{
        ArrayList workload;
        workload = driver.getWorkLoad();
        return workload;
    }
}
